﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;

namespace Sync3DCartDatabase
{
    [Serializable]
    public enum FTPProtocol 
    {
        [XmlEnum("0")]
        FTP = 0,
        [XmlEnum("1")]
        SFTP = 1 
    };

    [Serializable]
    public enum FTPSecure 
    {
        [XmlEnum("0")]
        None = 0,
        [XmlEnum("1")]
        Implicit = 1,
        [XmlEnum("2")]
        ExplicitSsl = 2,
        [XmlEnum("3")]
        ExplicitTls = 3
    };

    [XmlRoot("FTPSessionOptionInfo")]
    public class CSessionOptionCDO
    {
        /// <summary>
        /// FTP Machine Host name
        /// </summary>
        [XmlElement("HostName")]
        public string HostName { get; set; }

        /// <summary>
        /// FTP server Port Number
        /// </summary>
        [XmlElement("PortNumber")]
        public int PortNumber { get; set; }

        /// <summary>
        /// FTP Username
        /// </summary>
        [XmlElement("UserName")]
        public string UserName { get; set; }

        /// <summary>
        /// FTP Password
        /// </summary>
        [XmlElement("Password")]
        public string Password { get; set; }

        /// <summary>
        /// Hostkey Fingerprint (Required only for SFTP)
        /// </summary>
        [XmlElement("SshHostKeyFingerprint")]
        public string SshHostKeyFingerprint { get; set; }

        /// <summary>
        /// FTP Protocol to be used
        /// </summary>
        [XmlElement("FTPProtocol", typeof(FTPProtocol))]
        public FTPProtocol Protocol { get; set; }

        /// <summary>
        /// FTP secure mode to be used
        /// </summary>
        [XmlElement("FTPSecure", typeof(FTPSecure))]
        public FTPSecure FtpSecure { get; set; }

        /// <summary>
        /// 
        /// </summary>
        [XmlElement("SslHostCertificateFingerprint")]
        public string SslHostCertificateFingerprint { get; set; }
    }
}
